﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/PortalParts/PageMore.Master" CodeBehind="PartyEduCoursewareMore.aspx.cs" Inherits="ZHDJ.Web.Portal.Edu.PartyEduCoursewareMore" %>


<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="../../Resource/js/Nailthumb/jquery.nailthumb.1.1.min.css" rel="stylesheet" />
    <script src="../../Resource/js/Nailthumb/jquery.nailthumb.1.1.min.js"></script>
    <script src="../../Resource/js/default/jquery.tmpl.min.js"></script>
    <script src="../../Resource/js/knockout/knockout-3.4.0.js"></script>
    <script src="/Resource/js/jquery/jquery.pagination.js"></script>
    <script src="../../Resource/js/common.js"></script>
    <style>
        .nailthumb-container {
            margin-bottom: 0;
        }
    </style>
    <script>
        var pageSize = 9, isBind = false;
        var urlCategory = "";
        var initImgSize = function () {
            $('.nailthumb-container').each(function (i, n) {
                $(n).nailthumb({ width: 200, height: 150, method: 'corp', fitDirection: 'center center' });
            });

        }
        var paginationPara = {
            num_edge_entries: 1, //边缘页数
            num_display_entries: 4, //主体页数
            callback: pageselectCallback,
            items_per_page: pageSize, //每页显示1项
            prev_text: "上一页",
            next_text: "下一页",
            link_to: "javascript:void(0);"
        }
        var ViewModel = {
            qdate: ko.observableArray(),
            loadContacts: function (pageIndex) {
                $.get("PartyEduCoursewareMore.aspx", {
                    PageIndex: pageIndex,
                    PageSize: pageSize,
                    category: $("#ctl00_ContentPlaceHolder1_hfCategory").val(),
                    PageTitle: $("#ctl00_ContentPlaceHolder1_txtTitle").val(),
                    PageCategory: $("#ctl00_ContentPlaceHolder1_hftempCategory").val(),
                    r: (new Date()).getTime()
                },
                function (data) {
                    var ss = eval("(" + data + ")");

                    ViewModel.qdate(eval("(" + data + ")"));
                });
            }
        }

        function initPage(category) {
            $.get("PartyEduCoursewareMore.aspx", {
                DataCount: 1,
                category: $("#ctl00_ContentPlaceHolder1_hfCategory").val(),
                PageTitle: $("#ctl00_ContentPlaceHolder1_txtTitle").val(),
                PageCategory: category,
                r: (new Date()).getTime()
            },
                function (data) {
                    var totalCount = parseInt(data);
                    $("#pagination").pagination(totalCount, paginationPara);
                });
        }
        function pageselectCallback(pageIndex, jq) {
            ViewModel.loadContacts(pageIndex);
            if (!isBind) {
                ko.applyBindings(ViewModel);
                isBind = true;
            }

        }
        $(function () {
            $("#ctl00_ContentPlaceHolder1_hftempCategory").val(querystring("type"));
            initPage($("#ctl00_ContentPlaceHolder1_hftempCategory").val());
        });
        function searchclick() {
            $("#ctl00_ContentPlaceHolder1_hftempCategory").val($("#ctl00_ContentPlaceHolder1_ddlCategory").val());
            initPage($("#ctl00_ContentPlaceHolder1_hftempCategory").val());
            return false;
        }
    </script>

    <script id="myTemplate" type="text/x-jquery-tmpl">
        <li class="imgbox" title="${Title}">
            <a href="PartyEduCoursewareDetail.aspx?id=${ID}" target="_blank">
                <div class="nailthumb-container ">
                    <img src="${ImgUrl}" />
                </div>
            </a>
            <div class="titled" title="${Title}">${SubTitle}</div>
            <div class="timed">${CreateTime2}</div>
        </li>
    </script>
    <style>
        .select {
            /*position: absolute;*/
            width: 198px;
            height: 36px;
            padding: 0 24px 0 8px;
            /*color: #fff;*/
            /*font: 12px/21px arial,sans-serif;*/
            font-size: 16px;
            font-family: "宋体", Arial, Helvetica, sans-serif;
            /*background: url(select.png) no-repeat; /*span背景图片，其实就是dropdownlist图片*/
            overflow: hidden;
        }

        .textboxex {
            /*position: absolute;*/
            width: 198px;
            height: 36px;
            font-size: 16px;
            font-family: "宋体", Arial, Helvetica, sans-serif;
        }

        .btn {
            margin-left: 10px;
            height: 36px;
            width: 58px;
            font-size: 16px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:HiddenField ID="hfTotalCount" runat="server" Value="10" />
    <asp:HiddenField ID="hfCategory" runat="server" />
    <asp:HiddenField ID="hftempCategory" runat="server" />
    <asp:Label runat="server" ID="dd"> </asp:Label>
    <div style="margin-left: 28px; margin-top: 12px; line-height: 24px">
        <table border="0">
            <tr>
                <td><span style="font-size: 16px;color: #333;">标题：</span>
                    <asp:TextBox ID="txtTitle" runat="server" CssClass="textboxex"></asp:TextBox></td>
                <td><span style="font-size: 16px;margin-left:20px;color: #333;">类别：</span>
                    <asp:DropDownList ID="ddlCategory" runat="server" CssClass="select"></asp:DropDownList></td>
                <td>
                    <asp:Button ID="btnSearch" runat="server" Text="查询" CssClass="btn" OnClientClick="return searchclick();" /></td>
            </tr>
        </table>
    </div>
    <div class="ny_box" style="">
        <ul class="ulimg3" data-bind="template: { name: 'myTemplate', foreach: qdate, afterRender: initImgSize }">
        </ul>
        <div style="clear: both"></div>
        <div class="pagination">
            <div id="pagination">
            </div>
        </div>
    </div>

</asp:Content>

